/*动态添加routers*/
const asyncRoutes = [
  {
    path: 'home',
    name: 'Home',
    hidden: false,
    meta: { title: '首页', icon: 'el-icon-s-home', },
    component: resolve => require(['@/views/home'], resolve),
  },
  // icon图标
  {
    path: "icons",
    name: 'icons',
    hidden: false,
    meta: { title: 'icon图标', icon: "el-icon-s-goods", },
    component: resolve => require(['@/views/icons'], resolve),
  },
  // 图形验证码
  {
    path: '/captcha',
    name: 'captcha',
    meta: { title: '图形验证码', icon: 'el-icon-s-release' },
    hidden: false,
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/captcha/verify',
    children: [
      {
        path: 'verify',
        name: 'verify',
        meta: { title: '图形验证码', icon: 'el-icon-s-release' },
        hidden: false,
        component: resolve => require(['@/views/captcha/verify.vue'], resolve),
      }
    ]
  },
  // echarts
  {
    path: "/echarts",
    name: 'echarts',
    hidden: false,
    meta: { title: 'Echarts', icon: "el-icon-s-marketing", },
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/echarts/slideChart',
    children: [
      {
        path: "slideChart",
        name: 'slideChart',
        meta: { title: "滑动echarts", icon: "el-icon-s-marketing", },
        hidden: false,
        component: resolve => require(['@/views/echarts/slideChart.vue'], resolve),
      },
      {
        path: "dynamicChart",
        name: 'dynamicChart',
        meta: { title: "切换echarts", icon: "el-icon-s-marketing", },
        hidden: false,
        component: resolve => require(['@/views/echarts/dynamicChart.vue'], resolve),
      },
      {
        path: "mapChart",
        name: 'mapChart',
        meta: { title: "地图", icon: "el-icon-s-marketing", },
        hidden: false,
        component: resolve => require(['@/views/echarts/mapChart.vue'], resolve),
      },
      {
        path: "chinaMap",
        name: 'chinaMap',
        meta: { title: "中国地图", icon: "el-icon-s-marketing", },
        hidden: false,
        component: resolve => require(['@/views/echarts/chinaMap.vue'], resolve),
      },
    ]
  },
  // excel
  {
    path: "/excel",
    name: 'excel',
    meta: { title: 'Excel', icon: "icon-excel iconfont", },
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/excel/excelIn',
    children: [
      {
        path: "excelIn",
        name: 'excelIn',
        meta: { title: "excel导入", icon: "el-icon-document", },
        hidden: false,
        component: resolve => require(['@/views/excel/excelIn.vue'], resolve),
      },
      {
        path: "excelOut",
        name: 'excelOut',
        meta: { title: "excel导出", icon: "el-icon-document", },
        hidden: false,
        component: resolve => require(['@/views/excel/excelOut.vue'], resolve),
      },
      {
        path: "mutiheaderOut",
        name: 'mutiheaderOut',
        meta: { title: "多级表头导出", icon: "el-icon-document", },
        hidden: false,
        component: resolve => require(['@/views/excel/mutiheaderOut.vue'], resolve),
      },
    ]
  },
  // 组件封装
  {
    path: "/widgets",
    name: 'widgets',
    hidden: false,
    meta: { title: '封装组件', icon: "el-icon-s-claim", },
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/widgets/draggable',
    children: [
      {
        path: "draggable",
        name: 'draggable',
        meta: { title: "拖动组件", icon: "el-icon-brush", },
        hidden: false,
        component: resolve => require(['@/views/widgets/draggable.vue'], resolve),
      },
      {
        path: "banner",
        name: 'banner',
        meta: { title: "轮播组件", icon: "icon-lunbo iconfont", },
        hidden: false,
        component: resolve => require(['@/views/widgets/banner.vue'], resolve),
      },
      {
        path: "loading",
        name: 'loading',
        meta: { title: "加载组件", icon: "el-icon-loading", },
        hidden: false,
        component: resolve => require(['@/views/widgets/loading.vue'], resolve),
      },
      {
        path: 'leftSlipDelete',
        name: 'leftSlipDelete',
        meta: { title: '左滑删除', icon: 'el-icon-s-release' },
        hidden: false,
        component: resolve => require(['@/views/widgets/leftSlipDelete.vue'], resolve),
      },
      {
        path: 'form',
        name: 'form',
        meta: { title: 'form表单', icon: 'el-icon-notebook-2' },
        hidden: false,
        component: resolve => require(['@/views/widgets/form.vue'], resolve),
      },
      {
        path: 'segmentedUpload',
        name: 'segmentedUpload',
        meta: { title: '分段上传', icon: 'el-icon-notebook-2' },
        hidden: false,
        component: resolve => require(['@/views/widgets/segmentedUpload.vue'], resolve),
      },
    ]
  },
  // 可视化编排
  {
    path: "/visualization",
    name: 'visualization',
    meta: { title: '可视化编排', icon: "el-icon-s-help", },
    hidden: false,
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/visualization/modelList',
    children: [
      {
        path: "modelList",
        name: 'modelList',
        meta: { title: "模板列表", icon: "el-icon-s-grid", },
        hidden: false,
        component: resolve => require(['@/views/visualization/model/modelList.vue'], resolve),
      },
      {
        path: "createModel",
        name: 'createModel',
        meta: { title: "创建模板", icon: "el-icon-s-grid", },
        hidden: true,
        component: resolve => require(['@/views/visualization/model/createModel.vue'], resolve),
      },
      {
        path: "pageList",
        name: 'pageList',
        meta: { title: "页面列表", icon: "el-icon-s-grid", },
        hidden: false,
        component: resolve => require(['@/views/visualization/page/pageList.vue'], resolve),
      },
      {
        path: "createPage",
        name: 'createPage',
        meta: { title: "创建页面", icon: "el-icon-s-grid", },
        hidden: true,
        component: resolve => require(['@/views/visualization/page/createPage.vue'], resolve),
      },
      {
        path: "freeModel",
        name: 'freeModel',
        meta: { title: "自由模块", icon: "el-icon-s-grid", },
        hidden: false,
        component: resolve => require(['@/views/visualization/freeModel.vue'], resolve),
      },
      {
        path: "visualizationDetail",
        name: 'visualizationDetail',
        meta: { title: "可视化详情页", icon: "el-icon-s-grid", },
        hidden: false,
        component: resolve => require(['@/views/visualization/visualizationDetail.vue'], resolve),
      }
    ]
  },
  // mock数据
  {
    path: "/mockData",
    name: 'mockData',
    hidden: false,
    meta: { title: 'mock数据', icon: "el-icon-s-data", },
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/mockData/demo1',
    children: [
      {
        path: "demo1",
        name: 'demo1',
        meta: { title: "多选列表", icon: "el-icon-s-data", },
        hidden: false,
        component: resolve => require(['@/views/mockData/demo1.vue'], resolve),
      },
      {
        path: "demo2",
        name: 'demo2',
        meta: { title: "单选列表", icon: "el-icon-s-data", },
        hidden: false,
        component: resolve => require(['@/views/mockData/demo2.vue'], resolve),
      },
      {
        path: "demo3",
        name: 'demo3',
        meta: { title: "展开行列表", icon: "el-icon-s-data", },
        hidden: false,
        component: resolve => require(['@/views/mockData/demo3.vue'], resolve),
      },
      {
        path: "demo4",
        name: 'demo4',
        meta: { title: "树形列表", icon: "el-icon-s-data", },
        hidden: false,
        component: resolve => require(['@/views/mockData/demo4.vue'], resolve),
      },
    ]
  },
  // 单页面
  {
    path: "/singlePage",
    name: 'singlePage',
    meta: { title: '单页面', icon: "el-icon-s-management", },
    hidden: false,
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/singlePage/filmDetail',
    children: [
      {
        path: "filmDetail",
        name: 'filmDetail',
        meta: { title: "电影详情页", icon: "el-icon-tickets", },
        hidden: false,
        component: resolve => require(['@/views/singlePage/filmDetail.vue'], resolve),
      },
      {
        path: "TVDetail",
        name: 'TVDetail',
        meta: { title: "电视剧详情页", icon: "el-icon-tickets", },
        hidden: false,
        component: resolve => require(['@/views/singlePage/TVDetail.vue'], resolve),
      },
      {
        path: "zongyiDetail",
        name: 'zongyiDetail',
        meta: { title: "综艺详情页", icon: "el-icon-tickets", },
        hidden: false,
        component: resolve => require(['@/views/singlePage/zongyiDetail.vue'], resolve),
      },
      {
        path: "asideTopList",
        name: 'asideTopList',
        meta: { title: "顶部导航列表页", icon: "el-icon-tickets", },
        hidden: false,
        component: resolve => require(['@/views/singlePage/asideTopList.vue'], resolve),
      },
      {
        path: "aside1List",
        name: 'aside1List',
        meta: { title: "侧边栏列表页", icon: "el-icon-tickets", },
        hidden: false,
        component: resolve => require(['@/views/singlePage/aside1List.vue'], resolve),
      },
      {
        path: "aside2List",
        name: 'aside2List',
        meta: { title: "侧边栏二级列表页", icon: "el-icon-tickets", },
        hidden: false,
        component: resolve => require(['@/views/singlePage/aside2List.vue'], resolve),
      },
      {
        path: "flexPage",
        name: 'flexPage',
        meta: { title: "响应式页面", icon: "el-icon-tickets", },
        hidden: false,
        component: resolve => require(['@/views/singlePage/flexPage.vue'], resolve),
      },
    ]
  },
  // 权限配置
  {
    path: "/permission",
    name: 'permission',
    hidden: false,
    meta: { title: '权限配置', icon: "el-icon-lock", },
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/permission/menu',
    children: [
      {
        path: "menu",
        name: 'menu',
        meta: { title: "菜单管理", icon: "el-icon-menu", },
        hidden: false,
        component: resolve => require(['@/views/permission/menu.vue'], resolve),
      },
      {
        path: "roles",
        name: 'roles',
        meta: { title: "权限管理", icon: "el-icon-s-tools", },
        hidden: false,
        component: resolve => require(['@/views/permission/roles.vue'], resolve),
      },
      {
        path: "user",
        name: 'user',
        meta: { title: "用户管理", icon: "el-icon-s-check", },
        hidden: false,
        component: resolve => require(['@/views/permission/user.vue'], resolve),
      },
    ]
  },
  // vue相关
  {
    path: '/vueAbout',
    name: 'vueAbout',
    meta: { title: 'vue相关', icon: 'el-icon-connection' },
    hidden: false,
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/vueAbout/vueX',
    children: [
      {
        path: 'vueX',
        name: 'vueX',
        meta: { title: 'vueX状态管理', icon: 'el-icon-link' },
        hidden: false,
        component: resolve => require(['@/views/vueAbout/vueX.vue'], resolve),
      },
      {
        path: 'axios',
        name: 'axios',
        meta: { title: 'axios介绍', icon: 'el-icon-link' },
        hidden: false,
        component: resolve => require(['@/views/vueAbout/axios.vue'], resolve),
      },
      {
        path: 'router',
        name: 'router',
        meta: { title: 'router路由', icon: 'el-icon-link' },
        hidden: false,
        component: resolve => require(['@/views/vueAbout/routerlu.vue'], resolve),
      }
    ]
  },
  // 报错页面
  {
    path: '/errorPage',
    name: 'errorPage',
    meta: { title: '报错页面', icon: 'el-icon-s-release' },
    hidden: false,
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/errorPage/404',
    children: [
      {
        path: '404',
        name: '404',
        meta: { title: '404页面', icon: 'el-icon-s-release' },
        hidden: false,
        component: resolve => require(['@/views/errorPage/404.vue'], resolve),
      }
    ]
  },
  // 数据大屏编排
  {
    path: "/bigData",
    name: 'bigData',
    meta: { title: '数据大屏编排', icon: "el-icon-s-help", },
    hidden: false,
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/bigData/createBigData',
    children: [
      {
        path: "createBigData",
        name: 'createBigData',
        meta: { title: "创建大屏", icon: "el-icon-s-grid", },
        hidden: false,
        component: resolve => require(['@/views/bigData/createBigData'], resolve),
      },
    ]
  },
  // PDF大文件加载
  {
    path: "/PDFflie",
    name: 'PDFflie',
    meta: { title: 'PDF大文件', icon: "el-icon-s-help", },
    hidden: false,
    component: resolve => require(['@/layout/index.vue'], resolve),
    redirect: '/PDFflie/vuePDFpagination',
    children: [
      {
        path: "vuePDFpagination",
        name: 'vuePDFpagination',
        meta: { title: "PDF分页加载", icon: "el-icon-s-grid", },
        hidden: false,
        component: resolve => require(['@/views/PDFflie/vuePDFpagination.vue'], resolve),
      },
    ]
  },
]

export default asyncRoutes